<template>
  <div class="item" v-bind:class="{ active: isActive }" @click="goURL">
    <div class="title noselect">{{ title }}</div>
  </div>
</template>

<script>
export default {
  name: "NavMenuItem",
  props: ["title", "isActive", "url", "type"],
  data() {
    return {};
  },
  methods: {
    goURL() {
      this.$router.push({ path: this.url, query: {} });
      this.$parent.switchMenu(this.type);
    },
  },
  mounted() {},
};
</script>

<style>
.head-root .nav-menu .item {
  height: 50px;
  cursor: pointer;
  color: #606266;
  display: inline-block;
  margin-right: 30px;
}

.head-root .nav-menu .item:hover {
  background-color: #6a9ed4;
  color: #ffffff;
}

.head-root .nav-menu .item.active {
  background-color: #5494d8;
  display: inline-block;
  color: #ffffff;
  font-weight: bold;
  border-bottom: solid 3px #ffffff;
  height: 47px;
}

.head-root .nav-menu .item .title {
  color: #ffffff;
  font-size: 16px;
  margin-top: 15px;
  padding-left: 10px;
  padding-right: 10px;
}
</style>
